package com.hd.tiyu.yuejian.Activity;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.hd.tiyu.yuejian.LoginActivity;
import com.hd.tiyu.yuejian.R;

public class GeRenSettingActivity extends AppCompatActivity {
    private ImageView back_img;
    private LinearLayout click1,click2,click3,click4,click5;
    private Button tuichu;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ge_ren_setting);
        intiViews();
        inittEvents();
        intiData();
    }

    private void intiViews() {
        back_img=(ImageView)findViewById(R.id.img_bk);
        tuichu=(Button)findViewById(R.id.bt_tuichu);
        click1=(LinearLayout)findViewById(R.id.lin1);
        click2=(LinearLayout)findViewById(R.id.lin2);
        click3=(LinearLayout)findViewById(R.id.lin3);
        click4=(LinearLayout)findViewById(R.id.lin4);
        click5=(LinearLayout)findViewById(R.id.lin5);

    }


    private void inittEvents() {
        click1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(GeRenSettingActivity.this,GeRenUpdateActivity.class);
                startActivity(intent);
            }
        });

        click5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(GeRenSettingActivity.this,FanKuiActivity.class);
                startActivity(intent);
            }
        });
    }

    private void intiData() {
        back_img.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        tuichu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SharedPreferences mSharedPreferences=getSharedPreferences("loginUser", Context.MODE_PRIVATE);
                SharedPreferences.Editor editor=mSharedPreferences.edit();
                editor.clear().commit();
                Intent intent=new Intent(GeRenSettingActivity.this, LoginActivity.class);
                startActivity(intent);
                finish();

            }
        });

    }
}
